package com.yjd.comm.repayment.service;

import com.yjd.comm.base.enums.DbWREnums;
import com.yjd.comm.base.model.PagerModel;
import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.repayment.model.RepaymentDataModel;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：用户还款报表业务接口<br>
 * <b>time</b>：2017-06-27 08:56:34 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
public interface IRepaymentDataService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public RepaymentDataModel insert(RepaymentDataModel model) throws Exception;

	/**
	 * 批量插入
	 *
	 * @param models
	 * @throws Exception
	 */
	public void insertBatch(final List models) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(RepaymentDataModel model) throws Exception;

	/**
	 * 根据map更新数据
	 *
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public int updateByMap(Map paramMap) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception;

	/**
	 * 还款
	 * @param repayment_id 还款报表id
	 * @return void
	 * @throws
	 */
	public int repayment(Long repayment_id) throws Exception;

	/**
	 * 确认订单后退单，收取相应管理费
	 * Created by yangchangyan on 2017/7/6.
	 * @param order_id 订单id
	 * @param period 第period期
	 * @return void
	 * @throws
	 */
	public Double calcManagePrice(Long order_id, Integer period) throws Exception;

	/**
	 * 查询即将到达还款时间的订单
	 * @param param
	 * @return
	 * @throws Exception
	 */
	public List<RepaymentDataModel> reminderRepaymentOrder(Map<String,Object> param)throws Exception;


	/**
	 * 还款减免
	 * @param repayment_id
	 * @param price
	 * @throws Exception
	 */
	public void discount(Long repayment_id,Double price)throws Exception;

	/**
	 * 获取分页数据
	 *
	 * @param map
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("rawtypes")
	public PagerModel getRepaymentList(Map map, DbWREnums dbwr) throws Exception;


	/**
	 * 查询订单A模式下
	 * 某个时间段还款金额
	 * @param startTime
	 * @param endTime
	 * @return
	 * @throws Exception
	 */
	public Double querySumPepaymentPrice(Long startTime,Long endTime)throws Exception;

}
